﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using CommerceOne.Domains.IRepositories;
using CommerceOne.Models.Entities;

namespace CommerceOne.Domains.SqlRepositories
{
    public class SqlCityRepository : SqlRepositoryBase, ICityRepository
    {

        #region Singleton Instance
        private static SqlCityRepository _instance;
        public static SqlCityRepository Instance
        {
            get { return _instance ?? (_instance = new SqlCityRepository()); }
        }
        #endregion

        public List<City> GetCitiesByCountry(int countryId)
        {
            return this.SqlContext.Cities.Where(p => p.CountryRegionId == countryId).ToList();
        }
    }
}
